import request from '@/utils/request'


const api_name = `/car`

export default{

    getPageList(query){
        return request({
            url:`${api_name}/listPage`,
            method:'post',
            data:query
        })
    },
    //新增/修改
    saveCar(car){
        return request({
            url:`${api_name}`,
            method:'put',
            data:car
        })
    },
    //新增资源
    batchInsert(list){
        return request({
            url:'/carResources/batch',
            method:'post',
            data:list
        })
    },
    getResources(carId){
        return request({
            url:`/carResources/getResources/${carId}`,
            method:'get',
        })
    },
    //删除文件
    deleteImge(path){
        return request({
            url:`/txCos/delete?path=${path}`,
            method:'get'
        })
    },
    deleteResource(path){
        return request({
            url:`/carResources/imgUrl?imgUrl=${path}`,
            method:'delete'
        })
    },
    //批量上架
    batchOnSale(ids){
        return request({
            url:`${api_name}/batchOnSale`,
            method:'post',
            data:ids
        })
    },
    //批量下架
    batchOffSale(ids){
        return request({
            url:`${api_name}/batchOffSale`,
            method:'post',
            data:ids
        })
    }


}